/* ------------------------------------------------------------------------- */
/*
 * C O M P A N Y   P R O P R I E T A R Y
 * use or disclosure of data contained in this file is subject to the
 * requirements an the end of this file
 *
 * CLASSIFICATION: OFFEN / UNCLASSIFIED
 */
/* ------------------------------------------------------------------------- */

/* ######################################################################### */
/** \file M44_SensorFusionAndMappingTypes.cs
 * \brief	
 * 
 *  This file contains the implementation of the Module M44_SensorFusionAndMapping 
 * 
 *
 * PROJEKT:   NETWORKED MULTI-ROBOT SYSTEMS
 *
 * Copyright (c) 2008 Diehl BGT Defence GmbH & Co. KG
 *
 * \author    Jean-Charles RENAUD & Thomas KOPFSTEDT\n
 *            Diehl BGT Defence GmbH & Co. KG \n
 *            E-SL \n
 * \version   0.21
 * \date      2010-06-17
 *
 * \n \n
 * Versionshistory: \n
 * -----------------
 * - Version 0.10:   Bjoern STEURER                         2009-04-29 \n
 *    Merged functionality of M44_NaviSensorFusionTypes.cs and 
 *    M45_DataMappingTypes.cs in M44_SensorFusionAndMappingTypes.cs
 *    (SVN revision 222). See Versionshistory of original source files below
 *    
 * - Version 0.11: Bjoern STEURER                           2009-05-15 \n
 *    updated file to SVN revision 237
 *    communication of new interfaces struture partly implemented
 *    
 * - Version 0.12: Bjoern STEURER                           2009-05-20 \n
 *    communication of new interfaces struture; implementation continued
 *
 * - Version 0.13: Bjoern STEURER                           2009-06-04 \n
 *    minor changes due to implementation of new interfaces  
 *
 *  - Version 014: Bjoern STEURER                          2009-09-02 \n
 *    Receiving of tc_M13Uri for health monitoring and debug data 
 *    monitoring added; additional minor changes 
 *
 *  - Version 0.15: Bjoern STEURER                          2009-12-09 \n
 *    ReceiveLowResMapGlobal replaced by ReceiveUpdatedCells; Send 
 *    RobotSlamEstimate to M42 and M61; Send UpdatedCells to M61 replaces 
 *    SendLowResMap 
 *
 *  - Version 0.16: Bjoern STEURER                          2009-12-16 \n
 *    Receiving of EosScan(_Lrf3DMeasure, _Orientation3D) from M21 
 *
 * - Version 0.17: Thomas KOPFSTEDT                         2010-02-04 \n
 *   changes of class names due to cleanup in "interfaces.cs", and the 
 *   other interface classed to double names for the same class
 *   
 * - Version 0.18: Antonio MATTA                           2010-02-26 \n
 *   _state._Orientation variable added.
 *
 * - Version 0.19: Bjoern STEURER                          2010-03-10 \n
 *   Add member _SimulationTime (cl_SimulationTime) to _state 
  *
 *  - Version 0.20   Bjoern STEURER                        2010-04-13 \n
 *    Contract Identifier changed from schemas.tempuri.org in projects.nmrs.org
 *
 *  - Version 0.21:   Bjoern STEURER                        2010-06-07 \n
 *    _state variable b_MovementDetected added 
 *
 * - Version 0.22:   Antonio MATTA                         2010-06-08 \n
 *    Sensor fusion for the velocity component added.
 *    
 * - Version 0.23:   Antonio Matta                         2010-06-17 \n
 *    Some modifications done in order to fix a Navigation Sensor Fusion
 *    problem.
 *
 * #########################################################################
 * #########################################################################
 *
 * Versionshistory of original source files \n
 * ---------------------------------------- \n
 * 
 * Versionshistory of M44_NaviSensorFusionTypes.cs \n
 * ----------------------------------------------- \n
 * - Version 0.10:   Jean-Charles RENAUD & Thomas KOPFSTEDT 2008-10-07 \n
 *      
 * - Version 0.11:   Jean-Charles RENAUD & Thomas KOPFSTEDT 2008-10-24 \n
 *    Communication between services implemented
 *    
 * - Version 0.12:   Jean-Charles RENAUD & Thomas KOPFSTEDT 2008-10-30 \n
 *    Redesign of the Communication
 * 
 * - Version 0.13:   Thomas SCHATZ & Markus MAUDER 2008-12-08 \n
 *    GetSteeringAngles, ReceiveSteeringAngles, GetOdoData, ReceiveOdoData,
 *    GetAutonomyInfo, ReceiveAutonomyInfo for communication with M26 added
 *      
 * - Version 0.20: Thomas KOPFSTEDT                         2008-12-17 \n
 *   changes of interfaces based on input from SENER
 *   
 * - Version 0.21:   Markus MAUDER 2008-12-19 \n
 *   ReceivePlatformSensor removed from M44_NaviSensorFusionOperations,
 *   tf_SteeringAngles, OdoData, AutonomyInfo added to the state
 *   
 * - Version 0.22:   Markus MAUDER 2009-02-28 \n
 *   communication M44 -> M45: partnering replaced by service forwarder
 *  
 * 
 * Versionshistory of M45_DataMappingTypes.cs \n
 * ------------------------------------------ \n
 * - Version 0.10:   Jean-Charles RENAUD & Thomas KOPFSTEDT 2008-10-07 \n
 * 
 * - Version 0.11:   Jean-Charles RENAUD & Thomas KOPFSTEDT 2008-10-30 \n
 *    Redesign of the Communication
 *      
 * - Version 0.20:  Thomas KOPFSTEDT                        2008-12-17 \n
 *   changes of interfaces based on input from SENER
 *   
 * - Version 0.21:  Thomas SCHATZ & Markus MAUDER           2008-12-18 \n
 *    changes due to new interfaces document
 *    
 * - Version 0.22:  Thomas SCHATZ & Markus MAUDER           2008-12-22 \n
 *    included possibility to :
 *      ~ send UDPmsgM45toM33 
 *      ~ send UDPmsgM45toM63, central part only
 *      ~ receive UDPmsgM63toM45
 *      
 * - Version 0.23:  Markus MAUDER                           2009-02-25 \n
 *   - sending of RobotSlamEstimate to M70 replaced by RobotStateEstimate
 *   - receiving of RobotData from M13 added
 *   
 * - Version 0.24:  Markus MAUDER                           2009-02-28 \n
 *   - communication M45 -> M70: partnering replaced by service forwarder 
 *   - communication M45 -> M71: partnering replaced by service forwarder
 *   
 * - Version 0.25:  Thomas SCHATZ & Markus MAUDER           2009-03-02 \n
 *     communication redesign:
 *        - added new message type 'RcvInit', constisting of 
 *            ~ RobotData
 *            ~ IPPortDataModule
 *            ~ M70uri 
 *            ~ M71uri
 *        - deleted old messages
 *            ~ ReceiveRobotData
 *            ~ RcvIPPortDataModule
 *            ~ SubM70Uri
 *            ~ SubM71Uri
 *      
 * - Version 0.26: Thomas KOPFSTEDT                         2009-05-08 \n
 *   change from 2D Laser to 3D Laser for M21 connection (M20 has now no Laser)
 */
/* ######################################################################### */


using System;
using System.Collections.Generic;
using System.ComponentModel;
using Microsoft.Ccr.Core;
using Microsoft.Dss.Core.Attributes;
using Microsoft.Dss.ServiceModel.Dssp;
using Microsoft.Dss.ServiceModel.DsspServiceBase;
using W3C.Soap;
using Interfaces;
using Interfaces.Basis;
using NMRS.M50_SharedClasses;
/*Using the C Sharp Matrix Library*/
using NMRS.CSML;
/*This is for using dynamic lists*/
using System.Collections;


namespace NMRS.M44_SensorFusionAndMapping
{
	public sealed class Contract
	{
		[DataMember]
		public const string Identifier = "http://projects.nmrs.org/2008/09/m44_sensorfusionandmapping.html";
	}
	
	[DataContract]
	public class M44_SensorFusionAndMappingState
	{

    #region Variables
    protected cl_HealthData HealthData;
    protected cl_RobotStateEstimate RobotStateEstimate;
    protected cl_DebugDataM44 DebugDataM44;
    protected cl_RobotGPSINSState RobotGPSINSState;
    protected cl_RobotGPSINSState LastRobotGPSINSState;
    protected cl_RobotData RobotData;
    protected cl_RobotStateEstimate RobotSlamEstimate;
    protected cl_OdoData OdoData;
    protected cl_AutonomyInfo AutonomyInfo;
    protected cl_SimulationTime SimulationTime;
    protected float[] tf_SteeringAngles;
    protected Matrix Xnow;
    protected Matrix SlamXnow;
    protected Matrix Xlast;
    protected Matrix td_KalmanLast;  
    protected Matrix Xreal;
    protected Matrix SlamXreal;
    protected Matrix Xk;
    protected Matrix SlamXk;
    protected Matrix Vnow;
    protected Matrix Vlast;
    protected Matrix Vreal;
    protected Matrix Vk;
    protected cl_Pos3D tf_SlamError;
    protected cl_Orientation3D Orientation;
    protected cl_3DLrfMeasure Lrf3DMeasure;
    protected cl_3DLrfMeasure LastLrf3DMeasure;
    protected cl_3DLrfMeasure LastLastLrf3DMeasure;
    protected M44_KFDynObj KFDynObj;
    protected BackgroundReference BackgroundReference;
    protected isMovementStruct isMovement;
    protected bool b_MovementDetected;
    protected cl_DistanceMeasure DistanceMeasure;
    protected cl_Map2D HighResMap;
    protected cl_DynamicObjects DynamicObjects;
    protected ushort maxID;
    protected cl_Map2D LowResMap;
    protected ArrayList CellList;
    protected string tc_M13Uri;
    protected string tc_M40Uri;
    protected string tc_M42Uri;
    protected string tc_M61Uri;
    protected string tc_M70Uri;
    protected cl_DynamicObjects DetectedObstacles;
    protected cl_UpdatedCells UpdatedCells;
    protected cl_UpdatedCells OutUpdatedCells;
    protected cl_DynamicObjects DynObjectsGlobal;
    protected cl_DynamicObjects DetectedDynObjs;
    protected cl_Pos3D[,] CollisionMatrix;
    /*Variables to be used by the Extended Kalman Filter*/
    float f_QMatrixSigma;                                  //INS-GPS frecuency sample.

    [DataMember]
    public cl_OdoData _OdoData
    {
      get { return OdoData; }
      set { OdoData = value; }
    }
    [DataMember]
    public cl_AutonomyInfo _AutonomyInfo
    {
      get { return AutonomyInfo; }
      set { AutonomyInfo = value; }
    }
    [DataMember]
    public float[] _tf_SteeringAngles
    {
      get { return tf_SteeringAngles; }
      set { tf_SteeringAngles = value; }
    }  
    [DataMember]
    public cl_RobotStateEstimate _RobotSlamEstimate
    {
      get { return RobotSlamEstimate; }
      set { RobotSlamEstimate = value; }
    }
    [DataMember]
    public cl_RobotData _RobotData
    {
      get { return RobotData; }
      set { RobotData = value; }
    }
    [DataMember]
    public cl_RobotGPSINSState _RobotGPSINSState
    {
      get { return RobotGPSINSState; }
      set { RobotGPSINSState = value; }
    }
    [DataMember]
    public cl_RobotGPSINSState _LastRobotGPSINSState
    {
        get { return LastRobotGPSINSState; }
        set { LastRobotGPSINSState = value; }
    }
    [DataMember]
    public cl_DebugDataM44 _DebugDataM44
    {
      get { return DebugDataM44; }
      set { DebugDataM44 = value; }
    }
    [DataMember]
    public cl_HealthData _HealthData
    {
      get { return HealthData; }
      set { HealthData = value; }
    }
    [DataMember]
    public cl_RobotStateEstimate _RobotStateEstimate
    {
      get { return RobotStateEstimate; }
      set { RobotStateEstimate = value; }
    }
    [DataMember]
    public cl_SimulationTime _SimulationTime
    {
      get { return SimulationTime; }
      set { SimulationTime = value; }
    }
    [DataMember]
    [Description("Q Matrix Sigma")]
    public float _f_QMatrixSigma
    {
        get { return f_QMatrixSigma; }
        set { f_QMatrixSigma = value; }
    }
    [DataMember]
    [Description("XnowMatrix")]
    public Matrix _Xnow
    {
        get { return Xnow; }
        set { Xnow = value; }
    }
    [DataMember]
    [Description("SlamXnowMatrix")]
    public Matrix _SlamXnow
    {
        get { return SlamXnow; }
        set { SlamXnow = value; }
    }
    [DataMember]
    [Description("XlastMatrix")]
    public Matrix _Xlast
    {
        get { return Xlast; }
        set { Xlast = value; }
    }
    [Description("td_KalmanLastMatrix")]
    public Matrix _td_KalmanLast
    {
        get { return td_KalmanLast; }
        set { td_KalmanLast = value; }
    }
    [DataMember]
    [Description("Xk")]
    public Matrix _Xk
    {
        get { return Xk; }
        set { Xk = value; }
    }
    [DataMember]
    [Description("SlamXk")]
    public Matrix _SlamXk
    {
        get { return SlamXk; }
        set { SlamXk = value; }
    }
    [DataMember]
    [Description("Xreal")]
    public Matrix _Xreal
    {
        get { return Xreal; }
        set { Xreal = value; }
    }
    [DataMember]
    [Description("SlamXreal")]
    public Matrix _SlamXreal
    {
        get { return SlamXreal; }
        set { SlamXreal = value; }
    }
    [DataMember]
    [Description("VnowMatrix")]
    public Matrix _Vnow
    {
        get { return Vnow; }
        set { Vnow = value; }
    }
    [DataMember]
    [Description("VlastMatrix")]
    public Matrix _Vlast
    {
        get { return Vlast; }
        set { Vlast = value; }
    }
    [DataMember]
    [Description("Vk")]
    public Matrix _Vk
    {
        get { return Vk; }
        set { Vk = value; }
    }
    [DataMember]
    [Description("Vreal")]
    public Matrix _Vreal
    {
        get { return Vreal; }
        set { Vreal = value; }
    }
    [DataMember]
    public cl_DynamicObjects _DetectedDynObjs
    {
      get { return DetectedDynObjs; }
      set { DetectedDynObjs = value; }
    }
    [DataMember]
    public cl_DynamicObjects _DynObjectsGlobal
    {
      get { return DynObjectsGlobal; }
      set { DynObjectsGlobal = value; }
    }
    [DataMember]
    public cl_UpdatedCells _UpdatedCells
    {
      get { return UpdatedCells; }
      set { UpdatedCells = value; }
    }
    [DataMember]
    public cl_UpdatedCells _OutUpdatedCells
    {
        get { return OutUpdatedCells; }
        set { OutUpdatedCells = value; }
    }
    [DataMember]
    public cl_DynamicObjects _DetectedObstacles
    {
      get { return DetectedObstacles; }
      set { DetectedObstacles = value; }
    }
    [DataMember]
    public cl_Pos3D _tf_SlamError
    {
        get { return tf_SlamError; }
        set { tf_SlamError = value; }
    }
    [DataMember]
    public cl_Orientation3D _Orientation
    {
        get { return Orientation; }
        set { Orientation = value; }
    }
    [DataMember]
    public cl_3DLrfMeasure _Lrf3DMeasure
    {
      get { return Lrf3DMeasure; }
      set { Lrf3DMeasure = value; }
    }
    [DataMember]
    public cl_3DLrfMeasure _LastLrf3DMeasure
    {
        get { return LastLrf3DMeasure; }
        set { LastLrf3DMeasure = value; }
    }
    [DataMember]
    public cl_3DLrfMeasure _LastLastLrf3DMeasure
    {
        get { return LastLastLrf3DMeasure; }
        set { LastLastLrf3DMeasure = value; }
    }
    [DataMember]
    public M44_KFDynObj _KFDynObj
    {
        get { return KFDynObj; }
        set { KFDynObj = value; }
    }
    [DataMember]
    public BackgroundReference _BackgroundReference
    {
        get { return BackgroundReference; }
        set { BackgroundReference = value; }
    }
    [DataMember]
    public isMovementStruct _isMovement
    {
        get { return isMovement; }
        set { isMovement = value; }
    }
    [DataMember]
    public bool _b_MovementDetected
    {
        get { return b_MovementDetected; }
        set { b_MovementDetected = value; }
    }
    [DataMember]
    public cl_DistanceMeasure _DistanceMeasure
    {
      get { return DistanceMeasure; }
      set { DistanceMeasure = value; }
    }
    [DataMember]
    public cl_Map2D _HighResMap
    {
      get { return HighResMap; }
      set { HighResMap = value; }
    }
    [DataMember]
    public cl_DynamicObjects _DynamicObjects
    {
      get { return DynamicObjects; }
      set { DynamicObjects = value; }
    }
    [DataMember]
    public ushort _maxID
    {
        get { return maxID; }
        set { maxID = value; }
    }
    [DataMember]
    public cl_Map2D _LowResMap
    {
      get { return LowResMap; }
      set { LowResMap = value; }
    }
    [DataMember]
    public ArrayList _CellList
    {
        get { return CellList; }
        set { CellList = value; }
    }
    [DataMember]
    public cl_Pos3D[,] _CollisionMatrix
    {
        get { return CollisionMatrix; }
        set { CollisionMatrix = value; }
    }
    [DataMember]
    public string _tc_M13Uri
    {
      get { return tc_M13Uri; }
      set { tc_M13Uri = value; }
    }
    [DataMember]
    public string _tc_M40Uri
    {
      get { return tc_M40Uri; }
      set { tc_M40Uri = value; }
    }
    [DataMember]
    public string _tc_M42Uri
    {
      get { return tc_M42Uri; }
      set { tc_M42Uri = value; }
    }
    [DataMember]
    public string _tc_M61Uri
    {
      get { return tc_M61Uri; }
      set { tc_M61Uri = value; }
    }
    [DataMember]
    public string _tc_M70Uri
    {
      get { return tc_M70Uri; }
      set { tc_M70Uri = value; }
    }
    
    #endregion Variables

	}

  #region MainPort
  // implementation for more than 20 arguments:
  [ServicePort]
  public class M44_SensorFusionAndMappingOperations : PortSet
  {
    public M44_SensorFusionAndMappingOperations()
      : base(
        typeof(DsspDefaultLookup),
        typeof(DsspDefaultDrop),
        typeof(Get),
        typeof(Subscribe),
        typeof(Replace),
        ///typeof(SendRobotStateEstimate),
        typeof(ReceiveRobotGPSINSState),
        typeof(GetSteeringAngles),
        typeof(ReceiveSteeringAngles),
        typeof(GetOdoData),
        typeof(ReceiveOdoData),
        typeof(GetAutonomyInfo),
        typeof(ReceiveAutonomyInfo),
        typeof(SendLowResMap),
        typeof(SendRobotSlamEstimate),
        typeof(SendHighResMap),
        typeof(SendDynamicObjects),
        typeof(Receive3DLrfMeasure),
        typeof(ReceiveDistanceMeasure),
        typeof(ReceiveDetectedObstacles),
        typeof(ReceiveDetectedDynObjs),
        typeof(RcvInit),
        typeof(SubM13Uri),
        typeof(SubM40Uri),
        typeof(SubM42Uri),
        typeof(ReceiveUpdatedCells),
        typeof(ReceiveDynObjectsGlobal),
        typeof(SendUnpause)
      )
    {
    }

    // Untyped post
    public void Post(object item)
    {
      base.PostUnknownType(item);
    }

    #region Implicit conversions

    public static implicit operator Port<DsspDefaultLookup>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<DsspDefaultLookup>)portSet[typeof(DsspDefaultLookup)];
    }

    public static implicit operator Port<DsspDefaultDrop>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<DsspDefaultDrop>)portSet[typeof(DsspDefaultDrop)];
    }

    public static implicit operator Port<Get>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<Get>)portSet[typeof(Get)];
    }

    public static implicit operator Port<Subscribe>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<Subscribe>)portSet[typeof(Subscribe)];
    }

    public static implicit operator Port<Replace>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<Replace>)portSet[typeof(Replace)];
    }
    public static implicit operator Port<SendRobotSlamEstimate>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<SendRobotSlamEstimate>)portSet[typeof(SendRobotSlamEstimate)];
    }
    public static implicit operator Port<ReceiveRobotGPSINSState>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<ReceiveRobotGPSINSState>)portSet[typeof(ReceiveRobotGPSINSState)];
    }

    public static implicit operator Port<GetSteeringAngles>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<GetSteeringAngles>)portSet[typeof(GetSteeringAngles)];
    }

    public static implicit operator Port<ReceiveSteeringAngles>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<ReceiveSteeringAngles>)portSet[typeof(ReceiveSteeringAngles)];
    }

    public static implicit operator Port<GetOdoData>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<GetOdoData>)portSet[typeof(GetOdoData)];
    }

    public static implicit operator Port<ReceiveOdoData>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<ReceiveOdoData>)portSet[typeof(ReceiveOdoData)];
    }

    public static implicit operator Port<GetAutonomyInfo>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<GetAutonomyInfo>)portSet[typeof(GetAutonomyInfo)];
    }

    public static implicit operator Port<ReceiveAutonomyInfo>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<ReceiveAutonomyInfo>)portSet[typeof(ReceiveAutonomyInfo)];
    }

    public static implicit operator Port<SendLowResMap>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<SendLowResMap>)portSet[typeof(SendLowResMap)];
    }

    public static implicit operator Port<SendHighResMap>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<SendHighResMap>)portSet[typeof(SendHighResMap)];
    }

    public static implicit operator Port<SendDynamicObjects>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<SendDynamicObjects>)portSet[typeof(SendDynamicObjects)];
    }

    public static implicit operator Port<Receive3DLrfMeasure>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<Receive3DLrfMeasure>)portSet[typeof(Receive3DLrfMeasure)];
    }

    public static implicit operator Port<ReceiveDistanceMeasure>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<ReceiveDistanceMeasure>)portSet[typeof(ReceiveDistanceMeasure)];
    }

    public static implicit operator Port<ReceiveDetectedObstacles>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<ReceiveDetectedObstacles>)portSet[typeof(ReceiveDetectedObstacles)];
    }

    public static implicit operator Port<ReceiveDetectedDynObjs>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<ReceiveDetectedDynObjs>)portSet[typeof(ReceiveDetectedDynObjs)];
    }

    public static implicit operator Port<RcvInit>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<RcvInit>)portSet[typeof(RcvInit)];
    }

    public static implicit operator Port<SubM13Uri>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<SubM13Uri>)portSet[typeof(SubM13Uri)];
    }

    public static implicit operator Port<SubM40Uri>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<SubM40Uri>)portSet[typeof(SubM40Uri)];
    }

    public static implicit operator Port<SubM42Uri>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<SubM42Uri>)portSet[typeof(SubM42Uri)];
    }

    public static implicit operator Port<ReceiveUpdatedCells>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<ReceiveUpdatedCells>)portSet[typeof(ReceiveUpdatedCells)];
    }

    public static implicit operator Port<ReceiveDynObjectsGlobal>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<ReceiveDynObjectsGlobal>)portSet[typeof(ReceiveDynObjectsGlobal)];
    }

    public static implicit operator Port<SendUnpause>(
      M44_SensorFusionAndMappingOperations portSet)
    {
      if (portSet == null) return null;
      return (Port<SendUnpause>)portSet[typeof(SendUnpause)];
    }

    #endregion Implicit conversions
  }
  #endregion MainPort

  #region Get implementation
  public class Get : Get<GetRequestType, PortSet<M44_SensorFusionAndMappingState, Fault>>
	{
		public Get()
		{
		}
		
		public Get(GetRequestType body)
			: base(body)
		{
		}
		
		public Get(GetRequestType body, PortSet<M44_SensorFusionAndMappingState, Fault> responsePort)
			: base(body, responsePort)
		{
		}
  }
  #endregion

  #region Subscribe and replace implementation
  public class Subscribe : Subscribe<SubscribeRequestType,
      PortSet<SubscribeResponseType, Fault>>
  {

  }
  public class Replace : Replace<M44_SensorFusionAndMappingState, PortSet<DefaultReplaceResponseType, Fault>>
  {

  }
  #endregion

  #region Senders

  #region SendRobotSlamEstimate implementation (to M42, M61, M70)
  public class SendRobotSlamEstimate : Update<SendRobotSlamEstimateRequest, PortSet<DefaultUpdateResponseType, Fault>>
  {
    public SendRobotSlamEstimate()
    {
    }

    public SendRobotSlamEstimate(SendRobotSlamEstimateRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class SendRobotSlamEstimateRequest
  {
    private cl_RobotStateEstimate _RobotSlamEstimate;
    [DataMember(IsRequired = true)]
    public cl_RobotStateEstimate robotslamestimate
    {
      get { return _RobotSlamEstimate; }
      set { _RobotSlamEstimate = value; }
    }
    public SendRobotSlamEstimateRequest()
    {
    }
    public SendRobotSlamEstimateRequest(cl_RobotStateEstimate RobotSlamEstimate)
    {
      _RobotSlamEstimate = RobotSlamEstimate;
    }
  }
  #endregion

  #region SendHighResMap implementation (to M40, M42, M70)
  public class SendHighResMap : Update<SendHighResMapRequest, PortSet<DefaultUpdateResponseType, Fault>>
  {
    public SendHighResMap()
    {
    }

    public SendHighResMap(SendHighResMapRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class SendHighResMapRequest
  {
    private cl_Map2D _HighResMap;
    [DataMember(IsRequired = true)]
    public cl_Map2D highresmap
    {
      get { return _HighResMap; }
      set { _HighResMap = value; }
    }
    public SendHighResMapRequest()
    {
    }
    public SendHighResMapRequest(cl_Map2D HighResMap)
    {
      _HighResMap = HighResMap;
    }
  }
  #endregion

  #region SendLowResMap implementation (to M61, M70)
  public class SendLowResMap : Update<SendLowResMapRequest, PortSet<DefaultUpdateResponseType, Fault>>
  {
    public SendLowResMap()
    {
    }

    public SendLowResMap(SendLowResMapRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class SendLowResMapRequest
  {
    private cl_Map2D _LawResMap;
    [DataMember(IsRequired = true)]
    public cl_Map2D lawresmap
    {
      get { return _LawResMap; }
      set { _LawResMap = value; }

    }
    public SendLowResMapRequest()
    {

    }
    public SendLowResMapRequest(cl_Map2D LawResMap)
    {
      _LawResMap = LawResMap;
    }

  }
  #endregion

  #region SendDynamicObjects implementation (to M42, M61, M70)
  public class SendDynamicObjects : Update<SendDynamicObjectsRequest, PortSet<DefaultUpdateResponseType, Fault>>
  {
    public SendDynamicObjects()
    {
    }

    public SendDynamicObjects(SendDynamicObjectsRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class SendDynamicObjectsRequest
  {
    private cl_DynamicObjects _DynamicObjects;
    [DataMember(IsRequired = true)]
    public cl_DynamicObjects dynamicobjects
    {
      get { return _DynamicObjects; }
      set { _DynamicObjects = value; }

    }
    public SendDynamicObjectsRequest()
    {

    }
    public SendDynamicObjectsRequest(cl_DynamicObjects DynamicObjects)
    {
      _DynamicObjects = DynamicObjects;
    }

  }
  #endregion


  #region SendUnpause
  /// <summary>
  /// M50_Scheduler SendUnpause operation
  /// </summary>
  public class SendUnpause : Update<
    UnpauseBody,
    PortSet<DefaultUpdateResponseType, Fault>>
  {
    public SendUnpause()
    {
    }

    public SendUnpause(UnpauseBody body)
      : base(body)
    {
    }

    public SendUnpause(UnpauseBody body, PortSet<DefaultUpdateResponseType, Fault> responsePort)
      : base(body, responsePort)
    {
    }
  }

  /// <summary>
  /// The Body of SendUnpause
  /// </summary>
  [DataContract]
  [DataMemberConstructor]
  public class UnpauseBody
  {
    private cl_SchedulingInfo _SchedulingInfo;
    [DataMember(IsRequired = true)]
    public cl_SchedulingInfo schedulinginfo
    {
      get { return _SchedulingInfo; }
      set { _SchedulingInfo = value; }
    }

    public UnpauseBody()
    {
    }
    public UnpauseBody(cl_SchedulingInfo SchedulingInfo)
    {
      _SchedulingInfo = SchedulingInfo;
    }
  }
  #endregion SendUnpause


  #endregion Senders

  #region Receivers

  #region RcvInit (RobotData, tc_M61Uri, tc_M70Uri) (from M13)
  public class RcvInit : Update<
    RcvInitBody,
    PortSet<DefaultUpdateResponseType, Fault>>
  {
    public RcvInit()
    { }

    public RcvInit(RcvInitBody body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class RcvInitBody
  {
    [DataMember(IsRequired = true)]
    public cl_RobotData RobotData
    { get; set; }

    [DataMember(IsRequired = true)]
    public string tc_M61Uri
    { get; set; }

    [DataMember(IsRequired = true)]
    public string tc_M70Uri
    { get; set; }


    public RcvInitBody() { }

    public RcvInitBody(
      cl_RobotData robotdata,
      string M61uri,
      string M70uri
      )
    {
      RobotData = robotdata;
      tc_M61Uri = M61uri;
      tc_M70Uri = M70uri;
    }
  }
  #endregion RcvInit

  #region SubM13Uri (from M13)
  public class SubM13Uri : Submit<SubM13UriRequest, PortSet<DefaultSubmitResponseType, Fault>>
  {
    public SubM13Uri()
    { }

    public SubM13Uri(SubM13UriRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class SubM13UriRequest
  {
    [DataMember]
    public string tc_M13Uri
    { get; set; }

    public SubM13UriRequest() { }

    public SubM13UriRequest(string m13uri)
    {
      tc_M13Uri = m13uri;
    }
  }
  #endregion

  #region SubM40Uri (from M13)
  public class SubM40Uri : Submit<SubM40UriRequest, PortSet<DefaultSubmitResponseType, Fault>>
  {
    public SubM40Uri()
    { }

    public SubM40Uri(SubM40UriRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class SubM40UriRequest
  {
    [DataMember]
    public string _tc_M40Uri
    { get; set; }

    public SubM40UriRequest() { }

    public SubM40UriRequest(string m40uri)
    {
      _tc_M40Uri = m40uri;
    }
  }
  #endregion

  #region SubM42Uri (from M13)
  public class SubM42Uri : Submit<SubM42UriRequest, PortSet<DefaultSubmitResponseType, Fault>>
  {
    public SubM42Uri()
    { }

    public SubM42Uri(SubM42UriRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class SubM42UriRequest
  {
    [DataMember]
    public string _tc_M42Uri
    { get; set; }

    public SubM42UriRequest() { }

    public SubM42UriRequest(string m42uri)
    {
      _tc_M42Uri = m42uri;
    }
  }
  #endregion

  #region Receive3DLrfMeasure implementation (from M21)
  public class Receive3DLrfMeasure : Update<Receive3DLrfMeasureRequest, PortSet<DefaultUpdateResponseType, Fault>>
  {
    public Receive3DLrfMeasure()
    {
    }

    public Receive3DLrfMeasure(Receive3DLrfMeasureRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class Receive3DLrfMeasureRequest
  {
    private cl_EosScan _scan;
    [DataMember(IsRequired = true)]
    public cl_EosScan Scan
    {
      get { return _scan; }
      set { _scan = value; }
    }
    public Receive3DLrfMeasureRequest()
    {
    }
    public Receive3DLrfMeasureRequest(cl_EosScan scan)
    {
      _scan = scan;
    }
  }
  #endregion

  #region ReceiveRobotGPSINSState implementation (from M24)
  public class ReceiveRobotGPSINSState : Update<ReceiveRobotGPSINSStateRequest, PortSet<DefaultUpdateResponseType, Fault>>
  {
    public ReceiveRobotGPSINSState()
    {
    }

    public ReceiveRobotGPSINSState(ReceiveRobotGPSINSStateRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class ReceiveRobotGPSINSStateRequest
  {
    private cl_RobotGPSINSState _RobotGPSINSState;
    [DataMember(IsRequired = true)]
    public cl_RobotGPSINSState robotgpsinsstate
    {
      get { return _RobotGPSINSState; }
      set { _RobotGPSINSState = value; }

    }
    public ReceiveRobotGPSINSStateRequest()
    {

    }
    public ReceiveRobotGPSINSStateRequest(cl_RobotGPSINSState RobotGPSINSState)
    {
      _RobotGPSINSState = RobotGPSINSState;
    }

  }
  #endregion

  #region ReceiveDistanceMeasure implementation (from M25)
  public class ReceiveDistanceMeasure : Update<ReceiveDistanceMeasureRequest, PortSet<DefaultUpdateResponseType, Fault>>
  {
    public ReceiveDistanceMeasure()
    {
    }

    public ReceiveDistanceMeasure(ReceiveDistanceMeasureRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class ReceiveDistanceMeasureRequest
  {
    private cl_DistanceMeasure _DistanceMeasure;
    [DataMember(IsRequired = true)]
    public cl_DistanceMeasure distancemeasure
    {
      get { return _DistanceMeasure; }
      set { _DistanceMeasure = value; }

    }
    public ReceiveDistanceMeasureRequest()
    {

    }
    public ReceiveDistanceMeasureRequest(cl_DistanceMeasure DistanceMeasure)
    {
      _DistanceMeasure = DistanceMeasure;
    }

  }
  #endregion

  #region Communication with M26

  #region SteeringAngles

  public class GetSteeringAngles : Update<
        GetSteeringAnglesRequest,
        PortSet<DefaultUpdateResponseType, Fault>>
  {
    public GetSteeringAngles()
    { }

    public GetSteeringAngles(GetSteeringAnglesRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class GetSteeringAnglesRequest
  {
    public GetSteeringAnglesRequest() { }
  }

  public class ReceiveSteeringAngles : Update<
      ReceiveSteeringAnglesRequest,
      PortSet<DefaultUpdateResponseType, Fault>>
  {
    public ReceiveSteeringAngles()
    { }

    public ReceiveSteeringAngles(ReceiveSteeringAnglesRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class ReceiveSteeringAnglesRequest
  {
    private float[] _SteeringAngles;
    [DataMember(IsRequired = true)]
    public float[] steeringangles
    {
      get { return _SteeringAngles; }
      set { _SteeringAngles = value; }
    }
    public ReceiveSteeringAnglesRequest()
    {

    }
    public ReceiveSteeringAnglesRequest(float[] SteeringAngles)
    {
      _SteeringAngles = SteeringAngles;
    }
  }
  #endregion SteeringAngles

  #region OdoData
  public class GetOdoData : Update<
  GetOdoDataRequest,
  PortSet<DefaultUpdateResponseType, Fault>>
  {
    public GetOdoData()
    { }

    public GetOdoData(GetOdoDataRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class GetOdoDataRequest
  {
    public GetOdoDataRequest() { }
  }

  public class ReceiveOdoData : Update<
      ReceiveOdoDataRequest,
      PortSet<DefaultUpdateResponseType, Fault>>
  {
    public ReceiveOdoData()
    { }

    public ReceiveOdoData(ReceiveOdoDataRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class ReceiveOdoDataRequest
  {
    private cl_OdoData _OdoData;
    [DataMember(IsRequired = true)]
    public cl_OdoData ododata
    {
      get { return _OdoData; }
      set { _OdoData = value; }
    }
    public ReceiveOdoDataRequest()
    {

    }
    public ReceiveOdoDataRequest(cl_OdoData OdoData)
    {
      _OdoData = OdoData;
    }
  }
  #endregion OdoData

  #region AutonomyInfo
  public class GetAutonomyInfo : Update<
  GetAutonomyInfoRequest,
  PortSet<DefaultUpdateResponseType, Fault>>
  {
    public GetAutonomyInfo()
    { }

    public GetAutonomyInfo(GetAutonomyInfoRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class GetAutonomyInfoRequest
  {
    public GetAutonomyInfoRequest() { }
  }

  public class ReceiveAutonomyInfo : Update<
      ReceiveAutonomyInfoRequest,
      PortSet<DefaultUpdateResponseType, Fault>>
  {
    public ReceiveAutonomyInfo()
    { }

    public ReceiveAutonomyInfo(ReceiveAutonomyInfoRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class ReceiveAutonomyInfoRequest
  {
    private cl_AutonomyInfo _AutonomyInfo;
    [DataMember(IsRequired = true)]
    public cl_AutonomyInfo autonomyinfo
    {
      get { return _AutonomyInfo; }
      set { _AutonomyInfo = value; }
    }
    public ReceiveAutonomyInfoRequest()
    {

    }
    public ReceiveAutonomyInfoRequest(cl_AutonomyInfo AutonomyInfo)
    {
      _AutonomyInfo = AutonomyInfo;
    }
  }
  #endregion AutonomyInfo

  [DataContract]
  [DataMemberConstructor]
  public class SubRobotIdRequest
  {
    [DataMember]
    public string Identifier
    { get; set; }

    public SubRobotIdRequest() { }

    public SubRobotIdRequest(string identifier)
    {
      Identifier = identifier;
    }
  }
  #endregion Communication with M26

  #region ReceiveDetectedObstacles implementation (from M42)
  public class ReceiveDetectedObstacles : Update<ReceiveDetectedObstaclesRequest, PortSet<DefaultUpdateResponseType, Fault>>
  {
    public ReceiveDetectedObstacles()
    {
    }

    public ReceiveDetectedObstacles(ReceiveDetectedObstaclesRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class ReceiveDetectedObstaclesRequest
  {
    private cl_DynamicObjects _DetectedObstacle;
    [DataMember(IsRequired = true)]
    public cl_DynamicObjects detectedobstacles
    {
      get { return _DetectedObstacle; }
      set { _DetectedObstacle = value; }

    }
    public ReceiveDetectedObstaclesRequest()
    {

    }
    public ReceiveDetectedObstaclesRequest(cl_DynamicObjects DetectedObstacle)
    {
      _DetectedObstacle = DetectedObstacle;
    }

  }
  #endregion

  #region ReceiveDetectedDynObjs implementation (from M42)
  public class ReceiveDetectedDynObjs : Update<ReceiveDetectedDynObjsRequest, PortSet<DefaultUpdateResponseType, Fault>>
  {
    public ReceiveDetectedDynObjs()
    {
    }

    public ReceiveDetectedDynObjs(ReceiveDetectedDynObjsRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class ReceiveDetectedDynObjsRequest
  {
    private cl_DynamicObjects DetectedDynObjsLocal;
    [DataMember(IsRequired = true)]
    public cl_DynamicObjects DetectedDynObjs
    {
      get { return DetectedDynObjsLocal; }
      set { DetectedDynObjsLocal = value; }

    }
    public ReceiveDetectedDynObjsRequest()
    {

    }
    public ReceiveDetectedDynObjsRequest(cl_DynamicObjects DetectedDynObjsInput)
    {
      DetectedDynObjs = DetectedDynObjsInput;
    }
  }
  #endregion

  #region ReceiveUpdatedCells implementation (from M61)
  public class ReceiveUpdatedCells : Update<ReceiveUpdatedCellsRequest, PortSet<DefaultUpdateResponseType, Fault>>
  {
    public ReceiveUpdatedCells()
    {
    }

    public ReceiveUpdatedCells(ReceiveUpdatedCellsRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class ReceiveUpdatedCellsRequest
  {
    private cl_UpdatedCells _UpdatedCells;
    [DataMember(IsRequired = true)]
    public cl_UpdatedCells updatedcells
    {
      get { return _UpdatedCells; }
      set { _UpdatedCells = value; }
    }
    public ReceiveUpdatedCellsRequest()
    {
    }
    public ReceiveUpdatedCellsRequest(cl_UpdatedCells UpdatedCells)
    {
      _UpdatedCells = UpdatedCells;
    }
  }
  #endregion

  #region ReceiveDynObjectsGlobal implementation (from M61)
  public class ReceiveDynObjectsGlobal : Update<ReceiveDynObjectsGlobalRequest, PortSet<DefaultUpdateResponseType, Fault>>
  {
    public ReceiveDynObjectsGlobal()
    {
    }

    public ReceiveDynObjectsGlobal(ReceiveDynObjectsGlobalRequest body)
    {
      Body = body;
    }
  }

  [DataContract]
  [DataMemberConstructor]
  public class ReceiveDynObjectsGlobalRequest
  {
    private cl_DynamicObjects _DynObjectsGlobal;
    [DataMember(IsRequired = true)]
    public cl_DynamicObjects dynobjectsglobal
    {
      get { return _DynObjectsGlobal; }
      set { _DynObjectsGlobal = value; }

    }
    public ReceiveDynObjectsGlobalRequest()
    {

    }
    public ReceiveDynObjectsGlobalRequest(cl_DynamicObjects DynObjectsGlobal)
    {
      _DynObjectsGlobal = DynObjectsGlobal;
    }

  }
  #endregion

  #endregion Receivers
}
/* ------------------------------------------------------------------------- */
/*
 * RIGHT OF USE. This document may neither be passed on to third parties or
 * reproduced nor its contents utilized or divulged without the expressed
 * prior permission of the EUROPEAN DEFENCE AGENCY, or any national government
 * having rights on it. In case of contravention, the offender shall be
 * liable for damages.
 *
 * ATTENTION! DEFENCE MATERIAL. This document may contain data which is subject
 * to export control. For the export of this data an export license is
 * required.
 *
 * COMPANY PROPRIETARY. This document contains proprietary information and
 * may only be used by the recipient for the prescribed purposes and may
 * neither be reproduced in any form nor the document itself or its content
 * divulged to third parties without our expressed prior written permission.
 *
 * COPYRIGHT (C) Diehl BGT Defence GmbH & Co. KG; 2008; All rights reserved; 
 *
 * DISTRIBUTION AND USAGE RIGHTS: Restricted to the NETWORKED MULTI-ROBOT
 * SYSTEMS Project Consortium, participation governments, prime contractor,
 * subcontractors and vendors in accordance with contract / subcontract
 * clauses and / or other specified written agreements.
 */
/* ------------------------------------------------------------------------- */

